package cn.taoticket.controller;

import cn.taoticket.common.Dto;
import cn.taoticket.common.DtoUtil;
import cn.taoticket.service.HomeService;
import cn.taoticket.vo.HotItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 处理首页的Controller
 */
@RestController
@RequestMapping(value = "api/p/index")
public class HomeController {
    @Autowired
    private HomeService homeService;
    @RequestMapping(value = "queryBanner",method = RequestMethod.POST)
    public Dto<HotItemVo> queryBanner() throws Exception {
        List<HotItemVo> hotItemVos = homeService.queryBanner();
        return DtoUtil.returnDataSuccess(hotItemVos);
    }
}
